﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Aliyeye.Car.Net.UI.SystemModel;
using Aliyeye.Car.Net.UI.AdminCustomer;
using Aliyeye.Car.Net.UI.CarModel;
using Aliyeye.Car.Net.UI.SystemHelp;
using Aliyeye.Car.Net.UI.Common;

namespace Aliyeye.Car.Net.UI.SystemAdmin
{
    public partial class SystemAdminWork : BgForm
    {
        public SystemAdminWork()
        {
            InitializeComponent();
        }
        //车辆维修
        private void menuBlueLargeButton3_Click(object sender, EventArgs e)
        {
            Repair Repair = new Repair();
            Repair.ShowDialog();
        }
        //加油
        private void menuBlueLargeButton2_Click(object sender, EventArgs e)
        {
            Oil oil = new Oil();
            oil.ShowDialog();
        }
        //违章
        private void menuBlueLargeButton4_Click(object sender, EventArgs e)
        {
            if (Login.IsTestUser)
            {
                PageCommon.Alert(Login.TestUserMessage);
                return;
            }

            Illegal ill = new Illegal();
            ill.ShowDialog();
        }
        //事故
        private void menuBlueLargeButton6_Click(object sender, EventArgs e)
        {
            Accident acc = new Accident();
            acc.ShowDialog();
        }

        private void menuBlueLargeButton1_Click(object sender, EventArgs e)
        {
            if (Login.IsTestUser)
            {
                CarSvc.CarServiceSoapClient client = new Aliyeye.Car.Net.UI.CarSvc.CarServiceSoapClient();
                CarSvc.SoapHeaderClass sopaHeader = new Aliyeye.Car.Net.UI.CarSvc.SoapHeaderClass();
                DataSet ds = client.GetList(sopaHeader, "");
                if (ds != null)
                {
                    if (ds.Tables[0].Rows.Count >= 5)
                    {
                        PageCommon.Alert("已超过5部车，请连络QQ ：539217021！");
                        return;
                    }
                }
            }

            AddCarsNew AddCars = new AddCarsNew();
            AddCars.ShowDialog();
        }

        private void menuBlueLargeButton5_Click(object sender, EventArgs e)
        {
            CarList CarList = new CarList();
            CarList.ShowDialog();

        }
        //车辆保险
        private void menuBlueLargeButton7_Click(object sender, EventArgs e)
        {
            if (Login.IsTestUser)
            {
                PageCommon.Alert(Login.TestUserMessage);
                return;
            }
            Car_Insure car = new Car_Insure();
            car.ShowDialog();
        }
    }
}
